package com.example.controller;

import com.example.entity.File;
import com.example.service.FileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/")
public class IndexController {
    @Autowired
    FileService fileService;
    @RequestMapping("/index")
    public String returnIndex() {
        return "sys/index";
    }

    @RequestMapping("/fileInfo")
    public String fileInfo(Model model) {
        File file = fileService.selectById(1);
        model.addAttribute("file", file);
        System.out.println(file.toString());
        return "sys/testFile";
    }
}
